import request from '@/utils/request'

export async function getNotices(data) {
  return await request({
    url: '/adminSever/noticeBg/get-notices',
    method: 'POST',
    data
  })
}

export async function createNotice() {
  return await request({
    url: '/adminSever/noticeBg/create-notice',
    method: 'GET'
  })
}

export async function getNoticeAllById(id) {
  return await request({
    url: `/adminSever/noticeBg/get-notice/${id}`,
    method: 'GET'
  })
}

export async function updateNotice(data) {
  return await request({
    url: `/adminSever/noticeBg/update-notice`,
    method: 'POST',
    data
  })
}

export async function removeNoticesByIds(data) {
  return await request({
    url: `/adminSever/noticeBg/remove-notices`,
    method: 'DELETE',
    data
  })
}

export async function changeState(data) {
  return await request({
    url: `/adminSever/noticeBg/change-state`,
    method: 'PUT',
    data
  })
}

export async function getPreviewNewsContent(id) {
  return await request({
    url: `/adminSever/noticeBg/preview-content/${id}`,
    method: 'GET'
  })
}
